<template>
  <el-row class="mosWrap">
    <el-row type="flex" class="tableHeaderWrap">
      <div class="tableHeader">监测种类</div>
      <div class="tableHeader">数量</div>
      <div class="tableHeader">综合得分</div>
      <div class="tableHeader">时延(ms)</div>
      <div class="tableHeader" style="border-right: 1px solid rgba(102,153,153,0.5);">丢包(%)</div>
    </el-row>
    <div style="display: flex;flex-direction: column;height:calc(100% - 38px);">
      <el-row
        v-for="(city, index) in dataList"
        :key="index"
        type="flex"
        class="tableBody"
      >
        <div class="tableName" style="font-weight: 500">{{ city.type }}</div>
        <div class="tableName">{{ city.num }}</div>
        <div class="tableName">{{ city.score }}</div>
        <div class="tableName">{{ city.rat }}</div>
        <div class="tableName" style="border-right: 1px solid rgba(102,153,153,0.5);">{{ city.lost }}</div>
      </el-row>
    </div>
  </el-row>
</template>

<script>
  export default {
    name: 'TableLeft',
    props: {
      dataList: {
        type: Array,
        default: ()=>[]
      }
    },
    data() {
      return {
        dataType: 10
      }
    },
    methods: {
      clickedBtn(value) {
        this.dataType = value
        this.$bus.$emit('tableTypeChange', value)
      }
    }
  }
</script>

<style scoped>
.mosWrap{
  height: 100%;
  padding: 10px
}
.tableHeaderWrap{
  background: rgba(43,83,83,.9);
}
.tableHeader{
  flex: 1;
  color: #FFFFFF;
  border-top: 1px solid rgba(102,153,153,0.5);
  border-bottom: 1px solid rgba(102,153,153,0.5);
  border-left: 1px solid rgba(102,153,153,0.5);
  font-family: Microsoft Tai Le;
  font-weight: 400;
  font-size: 18px;
  line-height: 28px;
  height: 28px;
  text-align: center;
  padding: 4px 0;
}
.tableName{
  color: #FFFFFF;
  border-top: 1px solid rgba(102,153,153,0.5);
  border-bottom: 1px solid rgba(102,153,153,0.5);
  border-left: 1px solid rgba(102,153,153,0.5);
  font-family: Microsoft Tai Le;
  font-weight: 400;
  font-size: 16px;
  height: 100%;
  display: flex;
  flex: 1;
  justify-content: center;
  text-align: center;
  vertical-align: middle;
  flex-direction:column
}
.tableName > div {
  height: 36px;
  line-height: 36px;
}
.tableBody{
  background: rgba(43,83,83,.6);
  flex: 1;
  align-items: center;
}
</style>
